
#ifndef SX_STORED_MESH_ARCHETYPE_H
#define SX_STORED_MESH_ARCHETYPE_H

#include <sxGeometricObject_Archetype.h>
#include <sxStoredPhysicalRepresentation.h>
#include <sxMesh.h>

using Sx::Graphics::Archetypes::Objects::GeometricObject_Archetype;
using Sx::Graphics::Objects::Mesh;
using Sx::Graphics::Objects::Rendering::RendererImplementation;
using Sx::Physics::StoredPhysicalRepresentation;

namespace Sx {
namespace Physics {
namespace Archetypes {
namespace Objects {

class StoredMesh_Archetype :  public GeometricObject_Archetype<Mesh, float, StoredPhysicalRepresentation> {
public:
	StoredMesh_Archetype(const std::shared_ptr<RendererImplementation>& renderer);
	virtual ~StoredMesh_Archetype();

	/* 
	 * Provides a simple copy mechanism that will allow the provided data to
	 * be stored within the objects of this archetype.
	 */
	bool setStoredData(const Mesh& mesh, const StoredPhysicalRepresentation& storedRepresentation);

	bool pick(const Eigen::Vector3f& pickSegmentStart, const Eigen::Vector3f& pickSegmentEnd, Eigen::Vector3f& intersectionPoint);
	bool intersect(const Eigen::Vector3f& segment_p0, const Eigen::Vector3f& segment_p1, Eigen::Vector3f& intersectionPoint);
};

}

}

}

}

#endif
